typedstream NXImage Object NXEPSImageRep NXImageRep iisssss [1021c]%!PS-Adobe-2.0 EPSF-2.0 %%Title:Gear9.eps %%Creator: Kevin Brain (ksbrain@zeus.UWaterloo.ca) %%CreationDate: Thursday June 11 1992 %%Pages: 0 1 %%BoundingBox: 0 0 100 100 %%EndComments % eps drawing of a gear for Diagram palette /gears 9 store /orad 50 store % outer radius of gear /irad 25 store % inner radius of gear /iang {180 gears div} store % inner angle % sides of the teeth are computed to be parallel to a line drawn % from the centre of the gear to the center of the tooth % (involves cosine law...) /mess { irad 2 exp orad 2 exp sub irad 2 exp iang cos mul sub orad 2 exp neg div} store /oang {1 mess 2 exp sub sqrt mess div 1 atan} def /diffby2 {iang oang sub 2 div } def orad orad translate %mess 1 lt mess 0 gt and {0 -15 moveto (in range) show} {0 -15 moveto (out of range) show} ifelse irad 0 moveto 1 1 gears { pop % we don't use the value from the for 0 0 orad diffby2 dup oang add arc %0 0 orad 0 iang arc 0 0 irad iang dup 2 mul arc iang 2 mul rotate } for %0 0 moveto %(done) show